
// infdoc.h : interface of the CinfDoc class

class CinfDoc : public CDocument
{
private:	// Static proc
 static BOOL DoPromptFileName(CString& fileName, UINT nIDFilter, UINT nIDSTitle);
 static BOOL CALLBACK procEnumChild(HWND ahwnd, LPARAM );

protected: // create from serialization only
	CinfDoc();
	DECLARE_DYNCREATE(CinfDoc)

//	CinfDoc() {};
	bool LoadFileA(CArchive& ar);
 inline	void addNewLine(const CString & aline, CString & asect);
	bool testFile(const CString & afilepath, WCHAR * pBom = NULL);

// Operations
public:
	//e LPCWSTR getDesc() const { return m_proFile.getDesc(); };
 inline int getCount() const { return m_lstTable.GetCount(); }
	const LPCSVLINE getLine(int anindex);

// Overrides
public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual void DeleteContents();			// delete doc items etc
	virtual BOOL OnSaveDocument(LPCTSTR );
	virtual BOOL SaveModified();
	bool OnOpenRecentFile(LPCWSTR newName, BOOL bAddToMRU);	//	quasi

// Implementation
public:
	int pasteNextLine(HWND );
	virtual ~CinfDoc() {};
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// Attributes
protected:
	int				m_nIndex;
	TFILESEC		m_proFile;
	CList<TCSVLINE>	m_lstTable;

// Generated message map functions
public:
	afx_msg void OnFileCmds(UINT nCommandID);
	afx_msg void OnUpdateFileSave(CCmdUI *pCmdUI);
	afx_msg void OnUpdateFileSaveAs(CCmdUI *pCmdUI);

	DECLARE_MESSAGE_MAP()
};
